const state = {
  token: '',
  username: '',
  avatarurl: '',
  account: ''
}
const getters = {

}
const mutations = {
  GETTOKEN (state, value) {
    state.token = value
  },
  REMOVETOKEN (state, value) {
    state.token = ''
  },
  SETUSERNAME (state, value) {
    state.username = value
  },
  SETUSERAVATAR (state, value) {
    state.avatarurl = value
  },
  SETACCOUNT (state, value) {
    state.account = value
  }
}
const actions = {
  getToken (context, value) {
    context.commit('GETTOKEN', value)
  },
  removeToken (context, value) {
    context.commit('REMOVETOKEN', value)
  },
  setUsername (context, value) {
    context.commit('SETUSERNAME', value)
  },
  setUserAvatar (context, value) {
    context.commit('SETUSERAVATAR', value)
  },
  setAccount (context, value) {
    context.commit('SETACCOUNT', value)
  }
}
export default {
  namespaced: 'user',
  state,
  getters,
  mutations,
  actions
}
